<script setup>
    //跳转组件传递参数 / query 方案
    //跳转方案: 1.router-link   2. router.push 
    //id=1 & name = root 
    import { useRouter } from 'vue-router';

    let router =  useRouter();
    let sendQueryTo = ()=>{
        //router.push("/query/to?id=2&name=admin");
        // /query/to?id =2 & name = admin 
        router.push({path:'/query/to',query:{id:2,name:'admin'}});
    }

</script>

<template>
  <div>
    query方案发起者!
    <br>
    标签传递参数:  <br>
    <router-link to="/query/to?id=1&name=root">跳转到queryTo</router-link> <br>
    <router-link :to="{path:'/query/to',query:{id:1,name:'root'}}">跳转到queryTo</router-link> <br>
    编程传递参数: <br>
    <button @click="sendQueryTo()">跳转到queryTo</button>
  </div>
</template>

<style scoped>

</style>